<template>
  <div class="list-b-6 flexAuto">
    <ElCascaderBox :data="data" :dataName="[dataName.province, dataName.city, dataName.country]"
      :options="options || dataInfo.options" labelName="areaName" valueName="areaCode" />
    <ElInputBox :data="data" :dataName="dataName.address" type="textarea" v-if="dataName.address" placeholder="详细地址" />
  </div>
</template>
<script setup lang="ts">
const { proxy } = getCurrentInstance() as any;
const props = withDefaults(
  defineProps<{
    data?: any;
    dataName?: any;
    options?: any;
  }>(),
  {
    dataName: {
      province: 'province',//所在省
      city: 'city',//所在市
      country: 'country',//所在县
      address: '',//客户地址
    }
  },
);
const emit = defineEmits<{
  //fn为父组件引入子组件是定义的子组件事件属性，可随意定义
  (event: 'searchBtn'): void;
}>();
const dataInfo: any = reactive({
  options: []
});
import { getTreeAreaDataList } from '@/utils/optionsArr.ts';
onMounted(() => {
  if (!props.options) {
    getTreeAreaDataList(dataInfo, 'options')
  }
});
</script>
<style scoped lang="scss"></style>